package org.dromara.pay.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.pay.domain.TopUp;

/**
 * 充值表
 *
 * @author zlj
 * @since 2023/7/31
 */
public interface TopUpMapper extends BaseMapperPlus<TopUp, TopUp> {

    /**
     * 实际删除超时订单
     *
     * @param outTime
     * @return
     */
    @Delete("DELETE FROM sys_top_up WHERE create_time < DATE_SUB(NOW(), INTERVAL #{outTime} MINUTE) and `status` = 1")
    int deleteOutTimeTopUp(@Param("outTime") Integer outTime);
}




